package com.ywj.collection.Collections;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class CollectionsDemo {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        //原来写法
        list.add(9);
        list.add(14);
        list.add(8);
        list.add(320);
        System.out.println(list);  //[9, 14, 8, 320]

        //采用工具类 完成 往集合中添加元素
        Collections.addAll(list, 15, 14, 7, 310);
        System.out.println(list);

    }
}
